package huxibianjie.com.lbscandroid.util;

import android.content.Context;
import android.os.Environment;

import java.io.FileWriter;
import java.io.IOException;

public class LogUtils {
    public static void writeLog(Context context, String content) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(Environment.getExternalStorageDirectory() + "/" + context.getPackageName() + ("/LBSC_LOG_"+SystemUtils.getVersionCode(context)+".txt"), true);
            writer.write("V" + SystemUtils.getVersionName(context) + "(time：" + TimeUtils.msToString(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss") + "\t" + content + "\n");
            writer.close();
        } catch (IOException e) {
            MyLog.e("log", e.getMessage());
        }
    }
}
